import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter)

const Home = () => import('../src/views/home/home')
const category = () => import('../src/views/category/category')
const profile = () => import('../src/views/profile/profile')
const shopcart = () => import('../src/views/shopcart/shopcart')
const detail =()=> import('../src/views/detail/detail')

const routes = [
  {
    path:'',
    redirect:'/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/profile',
    component: profile
  },
  {
    path: '/shopcart',
    component: shopcart
  },
  {
    path: '/category',
    component: category
  },
  {
    path: '/detail/:iid',
    component:detail
  }
]
const router = new VueRouter({
  routes,
  mode:'history'
})

export default router
